package sury.dal.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import sury.common.constant.StatusConstant;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("tb_yb_role2")
public class Role2Entity implements Serializable {

    /**
     * 角色id
     */
    @TableId(value = "id")
    private Long id;

    /**
     *角色名
     */
    @TableField("name")
    private String name;

    /**
     *角色描述
     */
    @TableField("description")
    private String description;

    /**
     *是否启用
     */
    @TableField("status")
    private String status;

    // 检查角色是否启用
    public boolean isEnabled() {
        return StatusConstant.ENABLE.equals(status);
    }

}
